package HP.Demo;

import java.util.Scanner;

public class caishuzi_1 {


        public static void CaiShuZi(){
            System.out.println("------猜数字-----");


            // int q = (int)Math.random();
            int num = (int)(Math.random()*100)+1;
            System.out.println(num);

            while (true) {
                Scanner scanner = new Scanner(System.in);
                System.out.println("in put:");
                int input=  scanner.nextInt();

                if (input >num){
                    System.out.println("big!");
                }else if(input<num){
                    System.out.println("small!");
                }else if (input==num){
                    System.out.println("ok!");
                    break;
                }
                // System.out.println(q);
            }
        }

    }
